package com.demo.controller;

import java.text.ParseException;
import java.time.LocalDateTime;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.demo.service.DoctorService;
import com.demo.service.PaibanService;
import com.demo.service.UserService;

@RestController
@RequestMapping("/job")
@CrossOrigin
public class JobController {
	
	@Autowired
	private PaibanService paibanService;
	
	@Scheduled(cron = "0 */30 * * * ?")
	@RequestMapping("panbanZIdong")
	public String panbanZIdong() throws ParseException{
		 System.out.println("定时1"+LocalDateTime.now());
		 if(paibanService.checkdateuable()) {
			 paibanService.panbanZIdong();
		 }
		return null;
    	
    }
	

}
